<%@ Page Language="C#" Debug="true" %>
<%@ Import namespace="System.Net" %>
<%@ Import namespace="System.Collections.Generic" %>
<%@ Import namespace="Utils" %>
<%

string token = (string)Session["token"];

if(String.IsNullOrEmpty(token))
{
	token = ServiceUtil.getAccessToken();

	Session["token"] = token;
}

string jsonStr0 = "";
string jsonStr1 = "";
string jsonStr2 = "";

try
{
	jsonStr0 = ServiceUtil.getUsersJson(token);
	jsonStr1 = NetUtil.get("http://localhost:8080/database/customers", token);
	jsonStr2 = NetUtil.get("http://localhost:8080/database/products" , token);
}
catch(Exception ex)
{
	Response.Write(ex.Message+"<BR>");
}

Response.Write(token+"<BR>");
Response.Write(jsonStr0+"<BR>");
Response.Write(jsonStr1+"<BR>");
Response.Write(jsonStr2+"<BR>");
%>